package com.mzj.saas.mservice.community.repository;

import com.mzj.saas.mservice.community.entity.CommunityBuildUnit;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

public interface CommunityBuildUnitRepository extends PagingAndSortingRepository<CommunityBuildUnit, Long>, JpaSpecificationExecutor<CommunityBuildUnit> {
    List<CommunityBuildUnit> findByCommunityIdAndBuildId(String communityId, Long buildId);

    List<CommunityBuildUnit> findByCommunityIdAndBuildIdOrderByName(String communityId, Long buildId);

    List<CommunityBuildUnit> findByIdIn(List<Long> ids);
    List<CommunityBuildUnit> findByCommunityIdInAndBuildIdIn(List<String> communityId, List<Long> buildId);

    int countByCommunityId(String communityId);

    List<CommunityBuildUnit> findByBuildIdAndName( Long buildId,String name);

    List<CommunityBuildUnit> findByCommunityIdAndBuildIdAndName(String communityId, Long buildId,String name);

    List<CommunityBuildUnit> findByBuildId( Long buildId);

}
